package com.hadwinling.blog.service.impl;


import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.hadwinling.blog.entity.Notice;
import com.hadwinling.blog.mapper.NoticeMapper;
import com.hadwinling.blog.service.NoticeService;

import java.util.List;

/**
 * @author HadwinLing
 * @version V1.0
 * @Package com.hadwinling.blog.service.impl
 * @date 2020/8/20 14:25
 */
@Service
public class NoticeServiceImpl implements NoticeService {

    @Resource
    private NoticeMapper noticeMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return noticeMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Notice record) {
        return noticeMapper.insert(record);
    }

    @Override
    public int insertSelective(Notice record) {
        return noticeMapper.insertSelective(record);
    }

    @Override
    public Notice selectByPrimaryKey(Integer id) {
        return noticeMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Notice record) {
        return noticeMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Notice record) {
        return noticeMapper.updateByPrimaryKey(record);
    }

    @Override
    public int updateTopById(Integer updatedTop, Integer id) {
        return noticeMapper.updateTopById(updatedTop, id);
    }

    @Override
    public List<Notice> selectAllByState(Integer state) {
        return noticeMapper.selectAllByState(state);
    }

    @Override
    public List<Notice> selectAllByTopAndStateAndPowerstate(Integer top, Integer state, Integer powerState) {
        return noticeMapper.selectAllByTopAndStateAndPowerstate(top, state, powerState);
    }

    @Override
    public List<Notice> selectAllByStateOrderByCreatetimeDesc(Integer state) {
        return noticeMapper.selectAllByStateOrderByCreatetimeDesc(state);
    }


}


